package com.ruoyi.agriculture.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.agriculture.mapper.AgricultureMapper;
import com.ruoyi.agriculture.domain.Agriculture;
import com.ruoyi.agriculture.service.IAgricultureService;

/**
 * 产品销售Service业务层处理
 * 
 * @author z
 * @date 2025-08-25
 */
@Service
public class AgricultureServiceImpl implements IAgricultureService 
{
    @Autowired
    private AgricultureMapper agricultureMapper;

    /**
     * 查询产品销售
     * 
     * @param agricultureId 产品销售主键
     * @return 产品销售
     */
    @Override
    public Agriculture selectAgricultureByAgricultureId(Long agricultureId)
    {
        return agricultureMapper.selectAgricultureByAgricultureId(agricultureId);
    }

    /**
     * 查询产品销售列表
     * 
     * @param agriculture 产品销售
     * @return 产品销售
     */
    @Override
    public List<Agriculture> selectAgricultureList(Agriculture agriculture)
    {
        return agricultureMapper.selectAgricultureList(agriculture);
    }

    /**
     * 新增产品销售
     * 
     * @param agriculture 产品销售
     * @return 结果
     */
    @Override
    public int insertAgriculture(Agriculture agriculture)
    {
        agriculture.setCreateTime(DateUtils.getNowDate());
        return agricultureMapper.insertAgriculture(agriculture);
    }

    /**
     * 修改产品销售
     * 
     * @param agriculture 产品销售
     * @return 结果
     */
    @Override
    public int updateAgriculture(Agriculture agriculture)
    {
        agriculture.setUpdateTime(DateUtils.getNowDate());
        return agricultureMapper.updateAgriculture(agriculture);
    }

    /**
     * 批量删除产品销售
     * 
     * @param agricultureIds 需要删除的产品销售主键
     * @return 结果
     */
    @Override
    public int deleteAgricultureByAgricultureIds(Long[] agricultureIds)
    {
        return agricultureMapper.deleteAgricultureByAgricultureIds(agricultureIds);
    }

    /**
     * 删除产品销售信息
     * 
     * @param agricultureId 产品销售主键
     * @return 结果
     */
    @Override
    public int deleteAgricultureByAgricultureId(Long agricultureId)
    {
        return agricultureMapper.deleteAgricultureByAgricultureId(agricultureId);
    }
}
